<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    var str = "abc123Q**WE68_7aaav7!@ahf563#63abbbsd%^sda";
    
    console.log(str);

    // console.log( str.replace(/a/, "好") );
    // console.log( str.replace(/b/, "好") );
    // console.log( str.replace(/ab/, "好") );
    // console.log( str.replace(/a|b/, "好") );
    // console.log( str.replace(/a|b/g, "好") );
    // console.log( str.replace(/ab/g, "好") );
    // console.log( str.replace(/[a-z]/g, "好") );
    // console.log( str.replace(/[ab]/g, "好") );
    // console.log( str.replace(/[0-9]/g, "好") );
    // console.log( str.replace(/\d/g, "好") );
    // console.log( str.replace(/\w/g, "好") );
    // console.log( str.replace(/[0-9]+/g, "好") );
    // console.log( str.replace(/[^0-9a-z]+/g, "好") );
    // console.log( str.replace(/[^0-9]+/g, "好") );
    // console.log( str.replace(/\D+/g, "好") );
    // console.log( str.replace(/\W+/g, "好") );
    // console.log( str.replace(/[a-z]+/ig, "好") );
    // console.log( str.replace(/[a-zA-Z]+/g, "好") );
    // console.log( str.replace(/\*/g, "好") );
    // console.log( str.replace(/^a/g, "好") );
    // console.log( str.replace(/a$/g, "好") );
    // console.log( str.replace(/a|b+/g, "好") );
    // console.log( str.replace(/a+|b+/g, "好") );
    console.log( str.replace(/(a|b)+/g, "好") );

    
    


</script>
</html>